package com.zzu.base.controller.user.vo;

import com.zzu.base.common.enums.SexEnum;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class UserUpdateReqVO {
    @Positive
    @NotNull
    private Long id;
    @Size(min = 1, max = 20, message = "用户名长度为1-20个字符")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9]+$", message = "用户名只能包含中文、字母、数字")
    private String userName;

    @Size(min = 1, max = 20, message = "昵称长度为1-20个字符")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9]+$", message = "昵称只能包含中文、字母、数字")
    private String nickName;

    @Size(min = 12,max = 20,message = "密码长度为12-20个字符")
    @Pattern(
            regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]*$",
            message = "密码必须包含大小写字母、数字和特殊符号（@$!%*?&），且不能包含其他字符"
    )
    private String password;

    @Email(message = "邮箱格式不正确")
    private String email;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phoneNumber;

    private SexEnum sex;
}
